﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace _0712502_0712504_DesignPatternGame
{
    public class MainGame
    {
        MainGameContext mainGameContext;

        static public bool _exitGame = false;

        // Menu game
       // MenuGame _menuGameManager;


       // GameActions _gameActionManager;
        private GamePlay mGamePlay;
        /// <summary>
        /// Khoi tao cac ngu canh trong game
        /// </summary>
        public MainGame()
        {
            //GlobalVariables.nPlayers = 1;
            MediaPlayer.Volume = 1.0f;

            mainGameContext = MainGameContext.MenuGame;
            mGamePlay = new GamePlay();
        }

        public void Initilize()
        {
            mGamePlay.Initilize();
        }

        public void DrawToScreen(GameTime gameTime, SpriteBatch spriteBatch)
        {
           // switch (mainGameContext)
            {
              //  case MainGameContext.MenuGame:
              //      break;
             //   case MainGameContext.PlayGame:
                    mGamePlay.DrawToScreen(gameTime, spriteBatch);
             //       break;
            }
        }
        public void UpdateGame(ref GameTime gameTime)
        {
            switch (mainGameContext)
            {
                case MainGameContext.MenuGame:
                    mGamePlay.KhoiTaoManChoi();
                    mainGameContext = MainGameContext.PlayGame;
                    break;

                case MainGameContext.PlayGame:
                    {
                        // Cho phan Play game xu ly
                        mGamePlay.Update(gameTime);
                        break;
                    }
            }
        }

        public void ReadFileHistory()
        {

        }

        public void WriteFileHistory()
        {

        }
    }
}
